package com.teamwork.ZuccEcho.Repository;

import com.teamwork.ZuccEcho.Entity.Answer;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

public interface AnswerRepository extends JpaRepository<Answer,Long>, JpaSpecificationExecutor<Answer> {
    Answer findById(long id);

    @Query(value = "select * from answer where as_id=?1",nativeQuery = true)
    List<Answer> findAnswers(long as_id);
}
